#include <iostream>
#include <string>
#include <cstring>
#include <stack>
using namespace std;

typedef string newType;

typedef struct BTree
{
	newType data;
	struct BTree* lchild, * rchild;
}BTree;


void CreateBTree(BTree* &h) //创建
{
	h = new BTree;//申请空间
	cin >> h->data;
	if (h->data == "#") return;
	CreateBTree(h->lchild);
	CreateBTree(h->rchild);
}

void OutBTree(BTree* h, string&st) //左中右遍历
{
	if (h->data == "#") return;
	if (h->lchild->data == "#" && h->rchild->data == "#")
	{
		st+=h->data;
		return;
	}
	st += "(";
	OutBTree(h->lchild, st);

	st += h->data;

	OutBTree(h->rchild, st);
	st += ")";
}

bool isNumber(string& ch) //判断是否为数字
{
   return !(ch == "+" || ch == "-" || ch == "*" || ch == "/");
}

double ChNumber(string x) //把字母强转为数字
{
   int cnt = 0;
   for (int i = 0; x[i]; i++)
   {
       cnt = cnt * 10.0 + (x[i] - '0');
   }
   return cnt;
}

double Num(BTree*h)
{
	if (h->lchild->data == "#" && h->rchild->data == "#")
	{
		float cnt = 0;
		cnt = ChNumber(h->data);
		return cnt;
	}
	float num1 = Num(h->lchild), num2 = Num(h->rchild);
	if (h->data == "+") return 1.0 * num1 + num2;
	else if (h->data == "-") return 1.0 * num1 - num2;
	else if (h->data == "*") return 1.0 * num1 * num2;
	else if (h->data == "/") return 1.0 * num1 / num2;

}



int main()
{
	while (true)
	{
		BTree* h;
		h = new BTree;
		string st;
		if (!(cin >> h->data)) break; //不输入直接退出
		CreateBTree(h->lchild);
		CreateBTree(h->rchild);
		OutBTree(h, st);
		if (Num(h)>=24.001||Num(h) <= 23.999)
		{
			cout << "NO" << endl;
		}
		else cout << st << "=" << 24 << endl;

		delete h;
	}
	return 0;
}



//数据测试
//+++6 # # 6 # # 6 # # 6 # #
//- -*6 # # 6 # # 6 # # 6 # #
//* *1 # # 2 # # * 1 # # 2 # #